//AbstractFactory.java
package abstractFactory;

/**
 *@author:youtubezou
 *@version:2012-7-6
 */
public interface AbstractFactory {
	Button buttonFactory();
	Text textFactory();
}

/**
 * Unix type products factory
 */
class UnixFactory implements AbstractFactory {
	public Button buttonFactory() {
		return new UnixButton();
	}

	public Text textFactory() {
		return new UnixText();
	}
}

/**
 * Windows type products factory
 */
class WinFactory implements AbstractFactory {
	public Button buttonFactory() {
		return new WinButton();
	}

	public Text textFactory() {
		return new WinText();
	}
}

